using System.Linq;
namespace PersonalAccoutingProgram.Data
{
    partial class CategoryDataClassesDataContext
    {
        public static IQueryable<string> GetAllCategories()
        {
            CategoryDataClassesDataContext categpryDC =
                new CategoryDataClassesDataContext();
            var allCategories =
            from currentCategory in categpryDC.GetTable<Category>()
            select currentCategory.CategoryName;
            return allCategories;
        }

        public static IQueryable<int> GetCategoryID(string category)
        {
            ExpenseDataClassesDataContext expensesDC =
                    new ExpenseDataClassesDataContext();
            var categoryID =
            from currentCategory in expensesDC.GetTable<Category>()
            where currentCategory.CategoryName == category
            select currentCategory.CategoryID;
            return categoryID;
        }

    }
}
